<?php

   /**
    *
    * Convert an object to an array
    *
    * @param    object  $object The object to convert
    * @reeturn      array
    *
    * Example:-
    * ---convert the array to object---
    *    $array = objectToArray( $obj );
    *  --show the array--
    *    print_r( $array );
    *
    */
    function objectToArray( $object )
    {
        if( !is_object( $object ) && !is_array( $object ) )
        {
            return $object;
        }
        if( is_object( $object ) )
        {
            $object = get_object_vars( $object );
        }
        return array_map( 'objectToArray', $object );
    }



/* 
 * form_formater
 * 
 */
function my_build_attributes($arr,$seperator=' '){
  $tmp = '';
  //echo"<pre>";print_r($arr); return;
if(empty($arr)) return;
  foreach($arr as $k=>$v){
      $tmp .= "$k='{$v}'{$seperator}";
  }

  return $tmp;
}


?>
